home *** CD-ROM | disk | FTP | other *** search
- // ********************* File: Prog1.C ***********************
- // Demonstration of class KnotVec for representing knot vectors
- #include <KnotVec.h>
- #include <Vec_real.h>
- int main()
- {
- Vec(real) vec1(5);
- vec1.fill(1,5); // the content becomes 1 2 3 4 5
-
- KnotVec knots1; knots1.redim(5); knots1=vec1;
- s_o << "The first knot vector is like\n";
- knots1.print(s_o); s_o << "\n\n";
-
- KnotVec knots2(5); knots2=knots1;
- s_o << "The second knot vector is like\n";
- knots2.print(s_o); s_o << "\n\n";
-
- KnotVec knots3(vec1);
- s_o << "The third knot vector is like\n";
- knots3.print(s_o); s_o << "\n\n";
-
- KnotVec knots4(knots3); knots4.regulate(4);
- s_o << "The fourth knot vector is like\n";
- knots4.print(s_o); s_o << "\n";
- if (knots4.kRegular(4)) s_o << "And it is a 4-regular knot vector.\n";
- return 0;
- }
-